<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <div v-if="user==null">
        <h1>weibo-1首页</h1>
        <a href="/reg.html">注册</a>
        <a href="/login.html">登录</a>
    </div>
    <div v-else>
        <h1>欢迎回来</h1>
        <a href="">发表文章</a>
        <a href="">发表文章</a>
    </div>
</div>
<!--引入Vue框架-->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!--引入Axios框架-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script>
    let v = new Vue({
        el: "body>div",
        data: {
            user: null
        },
        methods: {},
        created: function () {
            axios.get("/currentUser").then(function (response) {
                v.user = response.data == "" ? null : response.data;
            })
        }
    })
</script>
</body>
</html>